
            				<div class="box span12">
					<div class="box-header" data-original-title>
						<h2><i class="icon-user"></i><span class="break"></span>Products Price List</h2>
						<div class="box-icon">
							<a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
							<a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn-close"><i class="icon-remove"></i></a>
						</div>
					</div>
					<div class="box-content">

<form action="/products/save-whole-sale-price" method="post"> 
	 <script language="javascript">
function inthe(id,idip,idwb){
	var elm = document.getElementById(id);
	var elm2 = document.getElementById(idip);
	var elm3 = document.getElementById(idwb); 
	
	var oldhtml = elm.innerHTML;
	var oldhtml2 = elm2.innerHTML;
	var oldhtml3 = elm3.innerHTML;
	
	var newhtml = "";
	var newhtml2 = "";
	var newhtml3 = "";
	
	if(oldhtml2.substr(1)==""){
		
		newhtml2 = "<input name=\"imp[" + id.substr(2)+ "]\" style=\"width:100px;\" type=\"text\" value=\"" + 0 + "\" />";
		}
	else{
		if(oldhtml2.substr(1)!="<"){
			newhtml2 = "<input name=\"imp[" + id.substr(2)+ "]\" style=\"width:100px;\" type=\"text\" value=\"" + oldhtml2.substr(1) + "\" />";
			}
		else{
				newhtml2 = oldhtml2;
			}	

	}
	if(oldhtml3.substr(0,1)=="$"){
		
		if(oldhtml3.substr(1)==""){	
		newhtml3 = "<input name=\"wbp[" + id.substr(2)+ "]\" style=\"width:100px;\" type=\"text\" value=\"" + 0 + "\" />";
	}
	else{
		newhtml3 = "<input name=\"wbp[" + id.substr(2)+ "]\" style=\"width:100px;\" type=\"text\" value=\"" + oldhtml3.substr(1) + "\" />";
	}
	
		
		}
	else{
		newhtml3 = oldhtml3;
	}	
	if(oldhtml.substr(0,1)=="$"){
	
	if(oldhtml.substr(1)==""){	
		newhtml = "<input name=\"wsp" + id.substr(2)+ "\" style=\"width:100px;\" type=\"text\" value=\"" + 0 + "\" /> <input name=\"submit\" type=\"submit\" value=\"save\" />";
	}
	else{
		newhtml = "<input name=\"wsp" + id.substr(2)+ "\" style=\"width:100px;\" type=\"text\" value=\"" + oldhtml.substr(1) + "\" /> <input name=\"submit\" type=\"submit\" value=\"save\" />";
		
	}
	}
	else{
		newhtml = oldhtml;
		}
	
	document.getElementById(id).innerHTML = newhtml;
	document.getElementById(idip).innerHTML = newhtml2;
	document.getElementById(idwb).innerHTML = newhtml3;
	return false;
	}
	</script>
<table class="table table-striped table-bordered bootstrap-datatable datatable_price ">

  <thead>
    <tr>
      <td>Barcode</td>
      <td>Img</td>
      <td>Title</td>
      <td>Stock</td>
      <td>Update On</td>
      <?php
      if(isset($_GET["show"]) && $_GET["show"]=="yes"){
	  ?>
      <td>Import Price</td>
      <td>We Buy Price</td>
      <?php
	  	}
	  ?>
      <td>WholeSale</td>
      <td>RRP</td>
            <?php
      if(isset($_GET["show"]) && $_GET["show"]=="yes"){
	  ?>
      <td>Action</td>
      <?php
	  	}
	  ?>      
    </tr>
  </thead>
  <tbody>
<?php
if(!empty($this->pList)){
 foreach($this->pList as $v) {?>  
    <tr>
      <td id="cp<?=$v["id_product"]?>" ><?=$v["code_product"]?></td>
      <td id="cp<?=$v["id_product"]?>" ><img src="/product_img/home_img/<?php echo $v['code_product']?>_0.jpg" width="100" /></td>
      <td id="tp<?=$v["id_product"]?>" ><?=$v["title_product"]?></td>
      <td><?=$v["stock_wh"]?></td>
      <td><?=$v["stock_wh_date"]?></td>
      <?php
      if(isset($_GET["show"]) && $_GET["show"]=="yes"){
	  ?>
      <td  id="ip<?=$v["id_product"]?>"  ><?php 
	  	switch($v["id_import_currency"]){
		case(1):{echo "$ ";break;}
		case(2):{echo "￥ ";break;}	
		}
	  ?>
	  	 <?=$v["price_import"]?></td>
      <td id="wb<?=$v["id_product"]?>" >$<?=$v["price_buy"]?></td>
      
      <?php
	  	}
	  ?>
      <td  id="wp<?=$v["id_product"]?>" >$<?=$v["price_wholesale_real"]?></td>
      <td  id="rp<?=$v["id_product"]?>" ><?=$v["price_rrp"]?></td>
                  <?php
      if(isset($_GET["show"]) && $_GET["show"]=="yes"){
	  ?>
      <td>

      <!--  <button type="button"  class="btn btn-mini btn-info"><i class="icon-edit icon-white"></i> Info</button> -->
      <button type="button" onclick="inthe('wp<?=$v["id_product"]?>','ip<?=$v["id_product"]?>','wb<?=$v["id_product"]?>')" class="btn btn-mini btn-danger"><i class="icon-edit icon-white"></i> Price</button></td>
<?php }?>      
    </tr>
 <?php 
 
 }
 }?>
  </tbody>

</table>	
</form>	
                         
            		</div>
                    </div>
	

                    